#ifndef KINECTCALIBRATIONDIALOG_H
#define KINECTCALIBRATIONDIALOG_H

#ifdef KINECT

#include <QDialog>
#include <QImage>

#include "GUI/kinect/kinectdialog.h"
#include "GUI/Troy/troyframe.h"

namespace Ui {
    class KinectCalibrationDialog;
}

/**
  * @brief Calibrates the Kinect sensor and identifies and begins tracking a user skeleton.
  *
  * When exec()'ed, if it accepts, then a user was calibrated, if it rejects, then the user cancelled the operation.
  */
class KinectCalibrationDialog : public KinectDialog {
private:
    Q_OBJECT
    Ui::KinectCalibrationDialog *ui;
    int closeTimer;
public:
    explicit KinectCalibrationDialog(kinect::Kinect* kinect, QWidget *parent = 0);
    ~KinectCalibrationDialog();
#ifdef WIIMOTE
    // Links the wiimotes signals to local slots to enable wiimote control
    void associateWiimote(WiimoteStatusDialog *dialog);
#endif
private slots:
    void searchForUser();
    void searchForPose();
    void holdPose();
    void calibrated(bool success = true);
    void updateImage(QImage* image);
    void kinectKeyFrame(MotionKeyFrame keyFrame);
private:
    void timerEvent(QTimerEvent *event);
    void hideEvent(QHideEvent *event);
    void showEvent(QShowEvent *event);
};

#endif // KINECT

#endif // KINECTCALIBRATIONDIALOG_H
